﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data.SqlClient;

namespace DataLayer
{
    public class dltaskhistory
    {
        public void AddTaskhistory(int taskid, int estimate, int real, string status)
        {
            string connStr = ConfigurationManager.ConnectionStrings["constring"].ConnectionString;
            string querystring = @"insert into Scrum.dbo.TaskHistory(TaskId,TimeStamp,EstimatedWorkload,RealWorkload,Status); values(" + taskid + ", CURRENT_TIMESTAMP, " + estimate + ", " + real + ", '" + status + "')";

            SqlConnection connection = new SqlConnection(connStr);
            SqlCommand queryuserstory = new SqlCommand(querystring, connection);
            
            connection.Open();

            queryuserstory.ExecuteNonQuery();

            connection.Close();

        }

    }
}
